VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsEmailExtract"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
Public Function EmailExtract(ByVal File1 As Variant, _
                             ByVal File2 As Variant, _
                             ByVal File3 As Variant, _
                             ByVal File4 As Variant, _
                             ByVal File5 As Variant, _
                             ByVal File6 As Variant) As String


'Send Mail
Dim cJMail As clsJMail
Set cJMail = New clsJMail
cJMail.EMailServer = "mindkey01.onsite.hosting.co.za"
cJMail.MsgFrom = "info@keytax.co.za"
cJMail.MSGFromName = "KeyTax: Tax Directives"
cJMail.MSGSubject = "Extracted Directive Request Files for " & Date
cJMail.MSGBody = "Extracted Directive Request Files for " & Date
cJMail.AddRecipient "shane.smith@liberty.co.za", "Shane Smith"
    
If Not File1 Is Nothing Then
    cJMail.AddAttachment File1
End If
If Not File2 Is Nothing Then
  cJMail.AddAttachment File2
End If
If Not File3 Is Nothing Then
  cJMail.AddAttachment File3
End If
If Not File4 Is Nothing Then
  cJMail.AddAttachment File4
End If
If Not File5 Is Nothing Then
  cJMail.AddAttachment File5
End If
If Not File6 Is Nothing Then
  cJMail.AddAttachment File6
End If


If Not cJMail.SendMSG Then
  EmailExtract = "Error sending email"
  Exit Function
End If

Set cJMail = Nothing

End Function

